package com.gulimall.api.fallback;

import com.gulimall.api.feign.WareClient;
import com.gulimall.common.core.domain.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import static com.gulimall.common.enums.BizCodeEnum.REQUEST_TOO_FAST;

@Component
@Slf4j
public class WareClientImpl implements WareClient {
    @Override
    public Result getProductStock(Long skuId) {
        log.info("熔断降级");
        return Result.fail(REQUEST_TOO_FAST.getCode(),REQUEST_TOO_FAST.getDesc());
    }

    @Override
    public Result reduceWare(Long skuId, Integer count) {
        log.info("熔断降级");
        return Result.fail(REQUEST_TOO_FAST.getCode(),REQUEST_TOO_FAST.getDesc());
    }
}
